<template>
  <el-drawer
    title="备案申请"
    :visible.sync="drawer"
    direction="rtl"
    :before-close="handleClose"
    size="1000px"
  >
    <div class="bock">
      <el-form
        ref="Form"
        :model="form_data"
        size="mini"
        label-position="right"
        label-width="160px"
        :rules="rules"
      >
        <el-collapse v-model="activeNames">
          <el-collapse-item title="基本信息" name="1">
            <el-col :span="12">
              <el-form-item label="场所名称" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入非经营性上网服务场所名称（以公司注册真实名称为准）"
                ></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="统一社会信用代码" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入非经营性上网服务场所统一社会信用代码"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="场所地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="省市区"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="场所详细地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入营业执照对应的注册地址"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="法人姓名" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入机构的法定代表人姓名"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证号" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入法人对应的身份证号码"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系方式（法人）" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入法人的联系方式"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="信息安全员" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入信息安全员负责人姓名"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证号" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入信息安全员对应的身份证号码"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系方式（负责人）" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入信息安全员负责人的联系方式"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-collapse-item>
          <el-collapse-item title="业务信息" name="2">
            <el-col :span="12">
              <el-form-item label="信息安全管理系统名称" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入信息安全管理系统名称及版本"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="计算机数量" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入计算机数量"
                ></el-input>
              </el-form-item>
            </el-col>
           
           
          </el-collapse-item>
        </el-collapse>
      </el-form>
    </div>
    <div class="drawerBtn">
      <el-button size="mini">取 消</el-button>
      <el-button size="mini" type="primary" @click="submit">确 认</el-button>
      <el-button size="mini" type="primary">暂 存</el-button>
    </div>
  </el-drawer>
</template>
<script>
export default {
  data() {
    return {
      drawer: false,
      activeNames: "1",
      fileList: [],
      form_data: {
        EVALUATE: "",
        PROCESS_NAME: "",
      },
      rules: {
        EVALUATE: [
          { required: true, message: "请输入评价", trigger: "blur" },
          {
            min: 1,
            max: 100,
            message: "长度在 1 到 100 个字符",
            trigger: "blur",
          },
        ],
      },
    };
  },
  methods: {
    isShow() {
      this.drawer = true;
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },

    submit() {
      this.$refs["Form"].validate((valid) => {
        if (valid) {
          let data = {
            MOR_BEHA_EVALUATE: this.form_data.EVALUATE,
            EVALUATION_SCORE_ID: this.data.EVALUATION_SCORE_ID,
          };
          this.loading = true;
          addEvaluate(data)
            .then((res) => {
              this.$message.success("评价成功");
              this.loading = false;
              this.$emit("submit");
              this.show = false;
            })
            .catch(() => {});
        } else {
          return false;
        }
      });
    },
    handleClose() {
      this.drawer = false;
    },
  },
};
</script>
<style scoped>
.bock {
  padding: 0px 20px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
</style>